package com.taptech.doufu.util;


import android.annotation.SuppressLint;
import android.content.Context;
import android.widget.Toast;

/**
 * 避免产生重复Toast
 */
public class NoRepeatToast {

	private static Context mContext = null;
	private static Toast mToast = null;

	@SuppressLint("ShowToast")
	public static Toast setToast(Context context, String hint) {
		if (mContext == context) {
			mToast.setText(hint);
		} else {
			mContext = context;
			mToast = Toast.makeText(context, hint, Toast.LENGTH_LONG);
		}
		return mToast;
	}
}

